package com.chenjun.core.vo.sys;

import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.util.List;

import org.springframework.beans.BeanUtils;

import com.chenjun.core.dao.generator.entity.SysRoleResource;

/**
 * 
 * @Description:
 * @author hasee
 * @date 2017年7月23日 下午4:47:06
 */
@SuppressWarnings("serial")
public class RoleResourceVo implements Serializable{
	
    /**
     * 角色资源表  
     * db_column: id 
     */	
	private String id;
    /**
     * 角色ID  
     * db_column: role_id 
     */	
	private String roleId;
    /**
     * 资源ID  
     * db_column: resource_id 
     */	
	private String resourceId;
	
	private List<String> resources;
	
	public void setId(String id) {
		this.id = id == null ? null : id.trim();
	}
	
	public String getId() {
		return this.id;
	}
	public void setRoleId(String roleId) {
		this.roleId = roleId == null ? null : roleId.trim();
	}
	
	public String getRoleId() {
		return this.roleId;
	}
	public void setResourceId(String resourceId) {
		this.resourceId = resourceId == null ? null : resourceId.trim();
	}
	
	public String getResourceId() {
		return this.resourceId;
	}
	
	public List<String> getResources() {
		return resources;
	}

	public void setResources(List<String> resources) {
		this.resources = resources;
	}

	/**
	 * 根据Bean获取Model模型
	 * @return
	 * PayBean
	 * @throws InvocationTargetException 
	 * @throws IllegalAccessException 
	 */
	public static RoleResourceVo getBeanByModel(SysRoleResource source) throws IllegalAccessException, InvocationTargetException{
		RoleResourceVo target = new RoleResourceVo();
		BeanUtils.copyProperties(source, target);
		return target;
	}
	
	
	/**
	 * 根据Model获取Bean模型
	 * @return
	 * PayBean
	 * @throws InvocationTargetException 
	 * @throws IllegalAccessException 
	 */
	public static SysRoleResource getModelByBean(RoleResourceVo source) throws IllegalAccessException, InvocationTargetException{
		SysRoleResource target = new SysRoleResource();
		BeanUtils.copyProperties(source, target);
		return target;
	}
	
	/**
	 * 根据Model获取Bean模型
	 * @return
	 * PayBean
	 * @throws InvocationTargetException 
	 * @throws IllegalAccessException 
	 */
	public static RoleResourceVo getBeanByDto(SysRoleResource source) throws IllegalAccessException, InvocationTargetException{
		RoleResourceVo target = new RoleResourceVo();
		BeanUtils.copyProperties(source, target);
		return target;
	}

}
